﻿.dropdown-toggle.dropdown-toggle-hidden::after {
    content: none !important;
}

.dropdown-toggle.dropdown-toggle-hidden::before {
    content: none !important;
}

.dropdown-menu.show {
    animation-duration: 0.3s;
    animation-fill-mode: both;
    animation-name: fadeIn;
}

.dropdown-menu a:not([href]).dropdown-item:not(.disabled) {
    cursor: pointer;
}

.dropdown-menu.dropdown-menu-scrollable {
    max-height: var(--dropdown-list-menu-max-height, 200px);
    overflow-y: scroll;
}

.b-is-autocomplete .dropdown-menu {
    width: 100%;
    max-height: var(--autocomplete-menu-max-height, 200px);
    overflow-y: scroll;
}

.b-is-autocomplete.b-is-autocomplete-multipleselection {
    max-width: 100%;
    width: 100%;
    cursor: text;
    height: calc(1.5em + .75rem + 2px);
    border: $input-border-width solid $input-border-color;
    border-radius: $input-border-radius;

    > input.form-control {
        display: inline-block;
        border: none;
        box-shadow: none;
        outline: none;
        background-color: transparent;
        max-width: inherit;
        width: auto;
    }

    @include form-control-focus
}

.dropdown.btn-group {
    > .btn.dropdown-toggle-split + .dropdown-menu.show {
        top: 100%;
    }
}

.dropdown {
    > .dropdown-menu {
        > .dropdown {
            position: relative;

            &::after {
                transform: rotate(-90deg);
                position: absolute;
                right: 6px;
                top: .8em;
            }

            > .dropdown-toggle {
                width: 100%;

                &::after {
                    transform: rotate(-90deg);
                    position: absolute;
                    right: 10%;
                    top: 45%;
                }
            }

            > .dropdown-menu {
                top: 0;
                left: 100%;
                margin-left: 0rem;
                margin-right: .1rem;
            }
        }
    }
}

@each $breakpoint in map-keys($grid-breakpoints) {
    @include media-breakpoint-up($breakpoint) {
        $infix: breakpoint-infix($breakpoint, $grid-breakpoints);

        .dropdown-menu#{$infix}-start {
            right: auto;
            left: 0;
        }

        .dropdown-menu#{$infix}-end {
            right: 0;
            left: auto;
        }
    }
}


// Allow for dropdowns to go bottom up (aka, dropup-menu)
// Just add .dropup after the standard .dropdown class and you're set.
.dropup {
    .dropdown-menu {
        top: auto;
        bottom: 100%;
        margin-top: 0;
        margin-bottom: $dropdown-spacer;
    }

    .dropdown-toggle {
        @include caret(up);
    }
}

.dropend {
    .dropdown-menu {
        top: 0;
        right: auto;
        left: 100%;
        margin-top: 0;
        margin-left: $dropdown-spacer;
    }

    .dropdown-toggle {
        @include caret(right);

        &::after {
            vertical-align: 0;
        }
    }
}

.dropstart {
    .dropdown-menu {
        top: 0;
        right: 100%;
        left: auto;
        margin-top: 0;
        margin-right: $dropdown-spacer;
    }

    .dropdown-toggle {
        @include caret(left);

        &::before {
            vertical-align: 0;
        }
    }
}
